<!DOCTYPE html>
<html lang="zh-CN"  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>头部</title>

    <!-- layui 公用样式 -->
    <meta th:include="common/commons :: layui"/>

</head>
<body>
<div class="layui-layout layui-layout-admin" id="app">
    <div class="layui-header">
        <div class="layui-logo"><img th:src="@{'/img/logo11.png'}" width="110px"/></div>
        <div class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <span th:text="'你好,'+${session.userName}" style="color: #FFF;padding-right: 50px"></span>
                <span th:text="${session.communityName}" style="color: #FFF;padding-right: 50px"></span>
            </li>
            <li class="layui-nav-item" id="editPassword">
                <a href="javascript:void(0);"> 修改密码 </a>
            </li>
            <li class="layui-nav-item" id="logout">
                <a href="javascript:void(0);"><i class="layui-icon layui-icon-logout"></i> 退出登录</a>
            </li>
        </div>
    </div>
</div>

<script>
    layui.use(['form', 'layer'], function () {
        let $ = layui.jquery;
        let layer = layui.layer;

        $("#editPassword").click(function () {
            alert("暂不可用")
        })

        $("#logout").click(function () {
            $.ajax({
                type: "get",
                url: ctx + '/user/logout',
                success: function (res) {
                    top.location.href = ctx + '/page/login';
                }
            });
        })
    })

</script>
</body>
</html>